package com.winning.cjfw.service.service.impl;

import com.winning.cjfw.service.entity.po.RecordLog;
import com.winning.cjfw.service.mapper.RecordLogMapper;
import com.winning.cjfw.service.service.RecordLogService;
import com.winning.cjfw.common.utils.UUIDUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author: yanxf@winning.com.cn
 * Description:
 * Date 2019/06/04 14:29
 */
@Service
@Slf4j
public class RecordLogServiceImpl implements RecordLogService {

    @Resource
    private RecordLogMapper recordLogMapper;


    @Override
    public List<RecordLog> findList(String rwid, String lx) {
        return recordLogMapper.findList( rwid, lx );
    }

    @Override
    public void insert(RecordLog recordLog) {
        if (StringUtils.isEmpty( recordLog.getUid() )) {
            recordLog.setUid( UUIDUtils.getUUID() );
        }
        recordLogMapper.insert( recordLog );
    }

    @Override
    public void update(RecordLog recordLog) {
        recordLogMapper.update( recordLog );
    }
}
